package com.goodving.guli.database;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;

import com.goodving.guli.bt.model.BasicDateData;
import com.goodving.guli.bt.model.C1495q;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/* renamed from: cn.com.smartdevices.bracelet.d.b */
public class C0855b extends C0853a {
    private static C0855b f4359a;

    static {
        f4359a = null;
    }

    private C0855b(Context context) {
        super(context);
    }

    public static synchronized C0855b m8954a(Context context) {
        C0855b c0855b;
        synchronized (C0855b.class) {
            if (f4359a == null) {
                f4359a = new C0855b(context);
                try {
                    f4359a.m8956a(false);
                } catch (Exception e) {
                    f4359a.m8951b();
                }
            }
            c0855b = f4359a;
        }
        return c0855b;
    }

    public int m8955a(String str, C1495q c1495q) {
        return C0878y.m9015a(m8956a(false), str, c1495q);
    }

    public SQLiteDatabase m8956a(boolean z) {
        return super.m8949a(z);
    }

//    public Partner m8957a(String str) {
//        return C0878y.m9016a(m8956a(false), str);
//    }

//    public String m8958a(String str, boolean z) {
//        return TextUtils.isEmpty(str) ? null : C0878y.m9018a(m8956a(false), str, z);
//    }

//    public ArrayList<HeartRateItem> m8959a(int i) {
//        return C0878y.m9019a(m8956a(false), i);
//    }
//
//    public ArrayList<HeartRateItem> m8960a(int i, int i2) {
//        return C0878y.m9020a(m8956a(false), i, i2);
//    }

    public ArrayList<BasicDateData> m8961a(C1495q c1495q) {
        return C0878y.m9021a(m8956a(false), c1495q);
    }

    public Map<String, String> m8962a(String[] strArr) {
        return strArr == null ? new HashMap(0) : C0878y.m9022a(m8956a(false), strArr);
    }

    public boolean m8963a(BasicDateData basicDateData, int i, C1495q c1495q) {
        return C0878y.m9029a(m8956a(true), basicDateData.date, basicDateData.data, c1495q, i, basicDateData.summary, basicDateData.indexs);
    }

//    public boolean m8964a(HeartRateItem heartRateItem) {
//        return heartRateItem == null ? false : C0878y.m9024a(m8956a(true), heartRateItem);
//    }

    public boolean m8965a(String str, int i, String str2) {
        return C0878y.m9025a(m8956a(true), str, i, str2);
    }

//    public boolean m8966a(String str, C1495q c1495q, byte[] bArr, String str2) {
//        return C0878y.m9026a(m8956a(true), str, c1495q, bArr, str2);
//    }

    public boolean m8967a(String str, String str2, C0890c c0890c) {
        return TextUtils.isEmpty(str) ? false : C0878y.m9027a(m8956a(true), str, str2, c0890c);
    }

    public boolean m8968a(String str, String str2, C1495q c1495q) {
        return (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) ? false : C0878y.m9028a(m8956a(true), str, str2, c1495q);
    }

    public boolean m8969a(String str, byte[] bArr, String str2, String str3, C1495q c1495q) {
        return m8970a(str, bArr, str2, str3, c1495q, null, null);
    }

    public boolean m8970a(String str, byte[] bArr, String str2, String str3, C1495q c1495q, byte[] bArr2, String str4) {
        try {
            return C0878y.m9032a(m8956a(true), str, bArr, str2, str3, c1495q, bArr2, str4);
        } catch (Throwable e ) {
            //TBD
        }
        return true;
    }

//    public boolean m8971a(ArrayList<HeartRateItem> arrayList, int i) {
//        return C0878y.m9033a(m8956a(true), (ArrayList) arrayList, i);
//    }

    public boolean m8972a(ArrayList<BasicDateData> arrayList, int i, C1495q c1495q) {
        return (arrayList == null || arrayList.size() < 1) ? true : C0878y.m9036a(m8956a(true), (List) arrayList, i, c1495q);
    }

//    public boolean m8973a(List<Partner> list) {
//        return (list == null || list.isEmpty()) ? false : C0878y.m9035a(m8956a(true), (List) list);
//    }

    public boolean m8974a(String[] strArr, String[] strArr2) {
        if (strArr != null && !C0857d.m8994a(strArr)) {
            return C0878y.m9037a(m8956a(true), strArr, strArr2);
        }
        throw new IllegalArgumentException();
    }

    public Cursor m8975b(C1495q c1495q) {
        return C0878y.m9039b(m8956a(false), c1495q);
    }

    public boolean m8976b(ArrayList<BasicDateData> arrayList, int i, C1495q c1495q) {
        return (arrayList == null || arrayList.size() < 1) ? true : C0878y.m9041b(m8956a(true), arrayList, i, c1495q);
    }

//    public boolean m8977b(List<HeartRateItem> list) {
//        return (list == null || list.isEmpty()) ? false : C0878y.m9042b(m8956a(true), (List) list);
//    }

    public byte[] m8978b(String str, C1495q c1495q) {
        return C0878y.m9043b(m8956a(false), str, c1495q);
    }

    public ArrayList<String> m8979c(C1495q c1495q) {
        return C0878y.m9044c(m8956a(false), c1495q);
    }

    public byte[] m8980c(String str, C1495q c1495q) {
        return C0878y.m9046c(m8956a(false), str, c1495q);
    }

    public String[] m8981c() {
        return C0878y.m9038a(m8956a(false));
    }

    public void m8982d() {
        m8950a();
    }

    public byte[] m8983d(String str, C1495q c1495q) {
        return C0878y.m9047d(m8956a(false), str, c1495q);
    }

    public String m8984e(String str, C1495q c1495q) {
        return C0878y.m9048e(m8956a(false), str, c1495q);
    }

//    public List<Partner> m8985e() {
//        return C0878y.m9040b(m8956a(true));
//    }

    public String m8986f(String str, C1495q c1495q) {
        return C0878y.m9017a(m8956a(false), str, c1495q, 1);
    }

    public boolean m8987f() {
        return C0878y.m9045c(m8956a(true));
    }

    public BasicDateData m8988g(String str, C1495q c1495q) {
        return C0878y.m9049f(m8956a(false), str, c1495q);
    }

    public SQLiteDatabase getReadableDatabase() {
        return super.m8949a(false);
    }

    public SQLiteDatabase getWritableDatabase() {
        return super.m8949a(true);
    }

    public Cursor m8989h(String str, C1495q c1495q) {
        return C0878y.m9050g(m8956a(false), str, c1495q);
    }
}
